arguments=`getopt -o ab:c:: --long after,before:,current:: -n "$(basename $0)" -- "$@"`
if [ $? != 0 ];then echo "terminating ..." >& 2; exit 1; fi

eval set -- "$arguments"
while true;do
        case "$1" in
                -a|--after) echo "after"; shift;;
                -b|--before) echo "before, $2"; shift 2;;
                -c|--current)
                        case "$2" in
                                "") echo "current, no arg"; shift 2;;
                                *) echo "current, $2"; shift 2;;
                        esac
                        ;;
                --) shift; break;;
                *) echo "invalid paramters"; exit 1;;
        esac
done

for arg in $@; do
echo "--> $arg"
done